<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.tjsinfo.tjsoa.system.vo.LianDong"%>
<%@page import="com.tjsinfo.tjsoa.documentationflow.xingzhengfawen.vo.TXingzhengfawenNeirong"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String rodomerstr = (String)request.getAttribute("rodomerstr");
String state = (String)request.getAttribute("state");
List zhusongList = (List)request.getAttribute("zhusong");
request.setAttribute("xingzhengfawenNeirong",new TXingzhengfawenNeirong());
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
  	<meta http-equiv="x-ua-compatible" content="ie=7" />
    <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>拟稿</title>

<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />  
<link href="<%=basePath%>style/shoufatable.css" rel="stylesheet" type="text/css" />  
	<link href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
    <script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script>
    <script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
    <script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxfileupload.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxFileZx.js"></script>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/init.js"></script>
 	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/extension/window/window.js"></script> 
 		<script type="text/javascript" src="<%=basePath %>js/common/system/selectbumenshenheren.js"></script>
	<%-- <script type="text/javascript" src="<%=basePath %>js/common/system/selecthegaolist.js"></script> --%>
	<script type="text/javascript" src="<%=basePath %>js/common/system/selectusertreecheckliandong.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/system/selectusertreecheck.js"></script>	
      <script type="text/javascript">
		function init(){
	 		var url = "<%=basePath%>documentationflow/xingzhengfawen/opendoc.jsp?docname=<%=rodomerstr+".doc"%>&WorkMode=2";
			with(document.all)
			{
		//	srctext.src = url;
			}
			initselectusertreecheck();
			initselectusertreecheckliandong("update");
			initselectbumenshenheren();
		}
		$(function(){
			$("#gwlz_title a").get(0).href="javascript:change(1)";
			$("#gwlz_title a").get(1).href="javascript:change(2)";
			$("#gwlz_title a").get(2).href="javascript:change(3)";
			$("#gwlz_title a").get(3).href="javascript:change(4)";
		});
		
		function change(start){
			if(start == 1)
			{
				$("#li1").addClass("over");
				$("#li2").removeClass();
				$("#li3").removeClass();
				$("#li4").removeClass();
				$("#span1").show();
				$("#span2").hide();
				$("#span3").hide();
				$("#span4").hide();	
			}
			else if(start == 2)
			{
				$("#li2").addClass("over");
				$("#li1").removeClass();
				$("#li3").removeClass();
				$("#li4").removeClass();
				$("#span2").show();
				$("#span1").hide();
				$("#span3").hide();
				$("#span4").hide();	
			}
			else if(start == 3)
			{
				$("#li3").addClass("over");
				$("#li1").removeClass();
				$("#li2").removeClass();
				$("#li4").removeClass();
				$("#span3").show();
				$("#span1").hide();
				$("#span2").hide();
				$("#span4").hide();	
			}
			else if(start == 4)
			{
				$("#li4").addClass("over");
				$("#li1").removeClass();
				$("#li2").removeClass();
				$("#li3").removeClass();
				$("#span4").show();
				var fuJian = $("#uploadList").text().replace(new   RegExp("删除",   "g"),   ",");
				fuJian = fuJian.substring(0,fuJian.length - 1);
				$("input[name=fujian]").val(fuJian);
				$("#span1").hide();
				$("#span2").hide();
				$("#span3").hide();	
			}
			
		}
		function f_submit(){
			if(istextareanull("#zhaiyao","请填写标题")
				&&isnull("input[name='hegaorenid']","请选择核稿人")
				&&isnull("input[name='zhusongidname']","请选择主送")
				&&isnull("input[name='zhusongid']","请选择主送")
				)
			{
				Ext.MessageBox.show({
			           title:'消息',
			           msg: '是否执行此操作?',
			           buttons: Ext.MessageBox.YESNO,
			           fn: function(btn){
			           	  if(btn == 'yes'){
			           	  	msg();
					//		srctext.savedoc();
							document.form1.submit();
			           	  }	
			           },
			           icon: Ext.MessageBox.QUESTION
			       });
				
				 		
			}
		}
		
/* 		function hegaoren(){
			var _win = selectHeGaoRenGridWin();
			_win.on("tradata",function(data){
				$("input[name=hegaorenname]").attr("value",data.userName);
				$("input[name=hegaorenid]").attr("value",data.userId);
				
			});			
		} */
		
		function zhusongchang(){
			if($("select[name=zhusongselect]").val() != 0){
				$("input[name=zhusongname]").val($("select[name=zhusongselect]").find("option:selected").text());
				$.get("<%=basePath %>tjsinfo/tjsoa/system/selectLianDongById.do",{id:$("select[name=zhusongselect]").find("option:selected").val()},function(data){
					$("input[name=zhusongidname]").val(Ext.decode(data).text);
					$("input[name=zhusongid]").val(Ext.decode(data).id);			
				});	
			}else{
				$("input[name=zhusongidname]").val("");
				$("input[name=zhusongid]").val("");	
				$("input[name=zhusongname]").val("");		
			}
			
		}
	</script>
				<!-- 执行上传文件操作的函数 -->
<script type="text/javascript">
var deleteFile;
var alreadyUploadFile='';
var uploadUrl='<%=basePath %>tjsinfo/tjsoa/system/ajaxFileUpload.do?method=uploader';
var deteleFileUrl='<%=basePath %>tjsinfo/tjsoa/system/ajaxFileUpload.do?method=deleted';
</script>	
  </head>
  <body onload="init()">
  	<form action="<%=basePath %>tjsinfo/tjsoa/xingzhengfawen/shenpi.do?method=nigao" method="post" name="form1">
  	 <div id="files" style="display: none;"></div>
   <div id="rightindex" style="height: 97%">
   <div id="tabtj"> 
      <!--导航开始处-->
      <div id="ttt">
        <div id="gwlz_title">
            <ul>
                <li id="li1"><a href="#"><span>发文承办单</span></a></li>
                <li class="over" id="li2"><a href="#"><span>正文</span></a></li>
                <li id="li3"><a href="#"><span>附件</span></a></li>
                <li  id="li4"><a href="#"><span>办理</span></a></li>
            </ul>
         <div style="text-align: right;padding-right: 10px"><a href="javascript:history.go(-1)"><img src="<%=basePath %>images/fanhui111.gif"/></a></div>           
        </div>
        <div style="overflow-y:scroll; height:96%">
        <div class="swcbdtab" style="display: none;" id="span1">
        
         <jsp:include page="./nigaozhi.jsp"></jsp:include>

        </div>
        <div class="swcbdtab" id="span2" >
         <table width="97%" border="0" cellpadding="0" cellspacing="0">
         	<tr><td align="right"></td></tr>
         </table>
       	
        <iframe id="srctext" width="100%" height="650px" frameborder=yes HTTP-EQUIV="Content-Type"  wrap="virtual"></iframe>
        </div>
        <div class="swcbdtab" style="display: none;" id="span3">
        	<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:80px">
              <tr>
                <td align="center">
                    <table width="564" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><img src="images/tjfj01.gif" /></td>
                      </tr>
                      <tr>
                        <td><div class="tjfjcontent">
                                <table width="90%" height="90%" border="0" cellspacing="0" cellpadding="0" class="researchtab">
                                
        							<tr>
                                  <td><div class="sc_listLong"><ul id="uploadList"></ul></div>
                				  <span><input type="file" UNSELECTABLE="on"  name="uploadFile" id="uploadFile" size="34" class="textinput" />&nbsp;&nbsp;<a style="cursor: hand" onclick="ajaxFileUpload()"><img src="<%=basePath %>images/scicon.gif" /></a></span></td>
                				</tr>
        				         
                                </table>
                            </div></td>
                      </tr>
                      <tr>
                        <td><img src="images/tjfj03.gif" /></td>
                      </tr>
                    </table>
                  
                </td>
              </tr>
          </table>
        	
        	
        </div>
        <div class="swcbdtab"  id="span4" style="display: none;">
        	<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:60px">
              <tr>
                <td align="center">
                	<table width="650" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><img src="images/bl11.gif" /></td>
                  </tr>
                  <tr>
                    <td><div class="blcontent">
                    	<h1>以下内容承办单体现</h1>
                    		<table width="98%" border="0" cellspacing="0" cellpadding="0" class="researchtab">
                              <tr>
                                <th width="20%" >标题</th>
                                <td  width="65%" align="left">
                                	<textarea cols="50" rows="5" name="zhaiyao" id="zhaiyao"></textarea>
                                	
                                </td>
                                  <td width="15%"><h2>（必填）</h2></td>
                              </tr>
                              <tr>
                                <th>主题词</th>
                                <td width="65%" align="left">                                	
                               		<input name="zhutici" type="text" size="20" id="numbertype"/>&nbsp;
                                </td>
                                  <td width="15%"></td>
                              </tr> 
                               <tr>
                                <th>附件</th>
                                <td width="65%" align="left"><input name="fujian" type="text" size="80" /></td>
                                <td><a href="javascript:change(3)">添加</a> </td>
                              </tr>
                               <tr>
                                <th valign="top">主送单位</th>
                                <td width="65%" align="left"><input name="zhusongname" type="text" size="50"  />&nbsp;<br/>
                                <select name="zhusongselect" onchange="zhusongchang()">
                                		<option value="0" selected="selected">请选择主送</option>
                                		<%
                                		    Iterator iterator =  zhusongList.iterator();
                                			while(iterator.hasNext())
                                			{
                                				LianDong lianDong = (LianDong)iterator.next();
                                		%>
                                		<option value="<%=lianDong.getId()%>"><%=lianDong.getLianDongLable()%></option>	
                                		<% 		
                                			}
                                		%>
                                		
                                </select></td>
                                 <td width="15%"><h2>（必填）</h2></td>
                              </tr>
                              <tr>
                                <th>抄送单位</th>
                                <td width="65%" align="left"><input name="chaosongname" type="text" size="80" /></td>
                                <td>&nbsp;</td>
                              </tr>
                            </table>
                          <h1>以下内容流程控制</h1>
                            <table width="98%" height="100%" border="0" cellspacing="0" cellpadding="0" class="researchtab">
                              <tr>
                                <th>选择主送</th>
                                <td width="65%" align="left">
                                  <input name="zhusongidname" id="zhusongidname" type="text"  readonly="readonly"  size="80" />
                                </td>
                                <td width="15%" align="left"><h2>（必填）<a href="javascript:selectusertreecheckliandongwinshow('zhusongid','zhusongidname','node')"><img src="images/yhglren.gif" /></a></h2></td>
                              </tr>
                              <tr>
                                <th>选择抄送</th>
                                <td width="65%" align="left">
                                  <input name="chaosongidname" id="chaosongidname" type="text" readonly="readonly" size="80" />
                                </td>
                                <td width="15%" align="left"><a href="javascript:selectusertreecheckwinshow('chaosongid','chaosongidname','node')"><img src="images/yhglren.gif" /></a></td>
                              </tr>
                              <tr>
                                <th>选择部门领导审核</th>
                                <td width="65%" align="left">
                                  <input  name="hegaorenname" id="hegaorenname" type="text" size="80" readonly="readonly" />
                                </td>
                                <td width="15%" align="left"><h2>（必填）<a href="javascript:selecbumenshenherenwinshow('hegaorenid','hegaorenname','huiqiannode')"><img src="images/yhglren.gif" /></a></h2></td>
                              </tr>
                            
                             </table>
                             <table width="98%" height="100%" border="0" cellspacing="0" cellpadding="0" class="researchtab">
                              <tr>
                                <td><a href="javascript:f_submit()"><img src="images/baocun.gif" /></a>&nbsp;<a href="javascript:history.go(-1)"><img src="images/qx.gif" /></a>
                                </td>
                               </tr>
                            </table>
                    	</div></td>
                  </tr>
                  <tr>
                    <td><img src="images/bl13.gif" /></td>
                  </tr>
                </table>
                
                   
                </td>
              </tr>
          </table>
        </div>
   	  </div>
   	  </div> 
   </div>
</div>
	  <input  type="hidden" name="docname" value="<%=rodomerstr+".doc"%>"/>
	  <input id="basePath" value="<%=basePath%>" type="hidden"/>
   	  <input id="zhusongid" value="" type="hidden" name="zhusongid"/>
   	  <input id="chaosongid" value="" type="hidden" name="chaosongid"/>
   	  <input id="hegaorenid" value="" type="hidden" name="hegaorenid"/>
   	  <input id="fuherenid" value="" type="hidden" name="fuherenid"/>
   	  <input id="huiqianrenid" value="" type="hidden" name="huiqianrenid"/>
   	  <input id="state" value="<%=state %>" type="hidden" name="state"/>
   	  <input id="node" value="" type="hidden"/>
   	  <input id="id" value="" type="hidden" name="id"/>
</form>
	
</body>
   
</html>
